The purpose of this package is to allow for felxible, programattic and interective plotting of brain connecectivty data within Rstudio - negating the need to swap to other visualsation tools and allowing for reproduceble integration of visauisation with analysis scripts that are written in R.
This package mainly contains two plotting functions: brainconn() and brainconn3D(). It also contails data.frames containing MNI centroid coordinates and region labels for brain atlases.
The brainconn() function allows users to input a binary/weighted and dierected/undirected (i.e. symetric) connectivity matrix which can be plotted in MNI space onto several brain atlses provided with the package. The brainconn3D() allows users to input a binary and undirected connectivity matrix which is plotted in a 3D and interactive matter using plottly to
The atleses currently included with in the packaage are: aal116, aal90, craddock200, dk68, dkt6s, schafer300_n7. Custom atleses can be added easily, see vignette [LINK]
The package can be installed using devtools.
install.packages("remotes")
remotes::install_github("sidchop/brainconn", build_vignettes = TRUE)
The functions are now installed, and you may load them when you want to use them.
The package also has a vignette, to help you get started. You can access it [ADD GIT LINK], or via R:
library(ggconn)
#>
#> Attaching package: 'ggconn'
#> The following object is masked from 'package:brainconn':
#>
#> build_plot
vignette("brainconn")
#> starting httpd help server ...
#> done
The primary user input is a connectivity matrix.
x <- read.csv("data/example/example_unweighted_undirected.txt", header = F)
brainconn(atlas ="Stages_melbBrain", conmat=x)
Modifyble features for brainconn include: view, node.size, node.color, edge.width, edge.color, edge.alpha, background.alpha, labels and others (see vignette)
p <- brainconn3D(atlas ="Stages_melbBrain", conmat=x, show.legend = F)
p